/* ===== MOBILE LAYOUT — separate parallel markup ===== */

/* Desktop: скрываем мобильный блок */
.m-page { display: none; }

@media (max-width: 768px) {
    /* Скрываем десктоп */
    .main_page { display: none !important; }

    /* Показываем мобильный блок */
    .m-page {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        background: #f0f2f5;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
        font-size: 14px;
        color: #1a1a1a;
    }

    /* ── reset browser margin ── */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* ── Header ── */
    .m-header {
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,.1);
    }

    .m-header__logo {
        display: block;
        width: 100%;
        height: auto;
    }

    .m-header__lang {
        display: flex;
        justify-content: flex-end;
        gap: 12px;
        padding: 5px 14px;
        border-top: 1px solid #ebebeb;
        background: #f9f9f9;
    }

    .m-header__lang a {
        font-size: 13px;
        color: #444;
        text-decoration: none;
    }

    .m-header__lang a:hover { color: #519c4a; }

    /* ── Breadcrumb ── */
    .m-breadcrumb {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 10px 14px;
        background: #fff;
        border-bottom: 1px solid #e8e8e8;
        font-size: 12px;
        color: #888;
    }

    .m-breadcrumb a { color: #519c4a; text-decoration: none; }
    .m-breadcrumb .sep { color: #bbb; }
    .m-breadcrumb .cur { color: #444; font-weight: 500; }

    /* ── Content wrapper ── */
    .m-content {
        flex: 1;
        padding: 14px 12px 24px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* ── Menu block (Recharge / Card) ── */
    .m-menu-block {
        background: #1a1a1a;
        border-radius: 10px;
        padding: 14px 18px;
        display: flex;
        align-items: baseline;
        gap: 8px;
    }

    .m-menu-block .m-menu-title {
        font-size: 20px;
        font-weight: 700;
        color: #fff;
        letter-spacing: .2px;
    }

    .m-menu-block .m-menu-sub {
        font-size: 14px;
        color: rgba(255,255,255,.6);
    }

    /* ── Section card ── */
    .m-section {
        background: #fff;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 1px 6px rgba(0,0,0,.08);
    }

    .m-section__head {
        background: #519c4a;
        color: #fff;
        font-size: 15px;
        font-weight: 600;
        padding: 12px 16px;
        text-align: center;
        letter-spacing: .2px;
    }

    .m-section__body {
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* ── Warning / info text ── */
    .m-warn {
        font-size: 13px;
        color: #b91c1c;
        background: #fef2f2;
        border-left: 3px solid #e53e3e;
        border-radius: 6px;
        padding: 10px 12px;
        line-height: 1.5;
    }

    .m-hint {
        font-size: 13px;
        color: #555;
        line-height: 1.5;
        margin: 0;
    }

    /* ── Error output ── */
    .m-error {
        font-size: 13px;
        color: #e53e3e;
        min-height: 18px;
    }

    /* ── Field label ── */
    .m-label {
        font-size: 11px;
        font-weight: 600;
        color: #888;
        text-transform: uppercase;
        letter-spacing: .5px;
        margin-bottom: 4px;
        display: block;
    }

    /* ── Card number input row ── */
    .m-card-row {
        display: flex;
        align-items: flex-end;
        gap: 6px;
    }

    .m-card-row .m-input--prefix {
        width: 52px;
        flex-shrink: 0;
        text-align: center;
        font-weight: 600;
        background: #eef0f3;
        color: #555;
    }

    .m-card-row .m-dash {
        font-size: 20px;
        color: #aaa;
        padding-bottom: 2px;
        flex-shrink: 0;
    }

    .m-card-row .m-input-group {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    /* ── Generic input ── */
    .m-input {
        width: 100%;
        height: 46px;
        padding: 0 12px;
        background: #f7f8fa;
        border: 1.5px solid #d1d5db;
        border-radius: 8px;
        font-size: 15px;
        color: #1a1a1a;
        outline: none;
        box-sizing: border-box;
        -webkit-appearance: none;
    }

    .m-input:focus {
        border-color: #519c4a;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(81,156,74,.15);
    }

    .m-input[readonly] {
        background: #eef0f3;
        cursor: default;
    }

    .m-input::placeholder { color: #bbb; }

    /* ── Select ── */
    .m-select {
        width: 100%;
        height: 46px;
        padding: 0 12px;
        background: #f7f8fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
        border: 1.5px solid #d1d5db;
        border-radius: 8px;
        font-size: 14px;
        color: #1a1a1a;
        outline: none;
        box-sizing: border-box;
        -webkit-appearance: none;
        cursor: pointer;
    }

    .m-select:focus {
        border-color: #519c4a;
        background-color: #fff;
        box-shadow: 0 0 0 3px rgba(81,156,74,.15);
    }

    /* ── Buttons ── */
    .m-btn {
        width: 100%;
        height: 48px;
        border: none;
        border-radius: 10px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        letter-spacing: .3px;
        -webkit-appearance: none;
    }

    .m-btn--primary {
        background: #519c4a;
        color: #fff;
        box-shadow: 0 2px 8px rgba(81,156,74,.3);
    }

    .m-btn--primary:active { background: #3d7a38; }

    .m-btn--secondary {
        background: #fff;
        color: #519c4a;
        border: 1.5px solid #519c4a;
    }

    .m-btn--secondary:active { background: #f0faf0; }

    .m-btn-row {
        display: flex;
        gap: 10px;
    }

    .m-btn-row .m-btn { flex: 1; }

    /* ── Basket link ── */
    .m-basket-link {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #fff;
        border: 1.5px solid #d1d5db;
        border-radius: 10px;
        padding: 12px 16px;
        text-decoration: none;
        color: #1a1a1a;
        font-size: 14px;
        box-shadow: 0 1px 4px rgba(0,0,0,.06);
    }

    .m-basket-link svg { flex-shrink: 0; }

    .m-basket-link.important { border-color: #e53e3e; color: #e53e3e; }

    .m-basket-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #519c4a;
        color: #fff;
        font-size: 12px;
        font-weight: 700;
        min-width: 20px;
        height: 20px;
        border-radius: 10px;
        padding: 0 5px;
        margin-left: 4px;
    }

    .m-basket-link.important .m-basket-count { background: #e53e3e; }

    /* ── Card info block ── */
    .m-card-info {
        display: flex;
        gap: 0;
        flex-wrap: wrap;
    }

    .m-card-info__cell {
        flex: 1;
        min-width: 80px;
        padding: 10px 0;
        border-right: 1px solid #e8e8e8;
    }

    .m-card-info__cell:last-child { border-right: none; }

    .m-card-info__cell:first-child { padding-left: 0; }

    .m-card-info__label {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: #888;
        margin-bottom: 4px;
    }

    .m-card-info__value {
        font-size: 14px;
        font-weight: 600;
        color: #1a1a1a;
        word-break: break-all;
    }

    /* ── Balance row ── */
    .m-balance {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
        border-top: 1px solid #f0f0f0;
    }

    .m-balance__label { font-size: 13px; color: #555; }

    .m-balance__value {
        font-size: 18px;
        font-weight: 700;
        color: #1a1a1a;
    }

    /* ── Steps progress ── */
    .m-steps {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        padding: 8px 0 4px;
    }

    .m-step {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .m-step__circle {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 700;
    }

    .m-step--active .m-step__circle {
        background: #519c4a;
        color: #fff;
    }

    .m-step--inactive .m-step__circle {
        background: #e8e8e8;
        color: #aaa;
    }

    .m-step__label {
        font-size: 10px;
        color: #888;
        white-space: nowrap;
    }

    .m-step--active .m-step__label { color: #519c4a; font-weight: 600; }

    .m-step-line {
        flex: 1;
        height: 2px;
        background: #e8e8e8;
        margin-bottom: 16px;
        max-width: 40px;
    }

    /* ── Order table ── */
    .m-order-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }

    .m-order-table thead th {
        text-align: left;
        padding: 6px 8px 8px;
        font-size: 11px;
        font-weight: 600;
        color: #888;
        text-transform: uppercase;
        letter-spacing: .4px;
        border-bottom: 1px solid #e8e8e8;
    }

    .m-order-table thead th:last-child { text-align: right; }

    .m-order-table tbody tr td {
        padding: 10px 8px;
        border-bottom: 1px solid #f4f4f4;
        vertical-align: top;
    }

    .m-order-table tbody tr:last-child td { border-bottom: none; }

    .m-order-table td:last-child { text-align: right; font-weight: 600; }

    .m-order-total {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 8px 4px;
        border-top: 2px solid #e8e8e8;
        font-weight: 700;
        font-size: 15px;
    }

    /* ── Checkbox row ── */
    .m-check-row {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: #444;
    }

    .m-check-row input[type=checkbox] {
        width: 18px;
        height: 18px;
        accent-color: #519c4a;
        flex-shrink: 0;
    }

    .m-check-row a { color: #519c4a; }

    /* ── Footer ── */
    .m-footer {
        background: #7a1010;
        color: #fff;
        text-align: center;
        font-size: 12px;
        padding: 14px 16px;
        border-radius: 0;
    }
}
